<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>16-双层for循环简单案例</title>
	</head>
	<body>
		<script type="text/javascript">
			/**
			 * 1.定义一个变量测算双层for循环相同的值的总和
			 * 2.将外层和内层循环的条件进行动态设置
			 */
			var outside = prompt('请输入外层循环的临界值!');
			var inside = prompt('请输入内层循环的临界值!');
			var total = 0;
			for(var i=0;i<parseInt(outside);i++){
				for(var j=2;j<parseInt(inside);j++){
					if(i==j){
						total+=j;
					}
				}
			}
			console.log("总和::"+total);
		</script>
	</body>
</html>
